﻿package {
	import flash.display.*;
	import flash.text.*;
	import flash.events.*;
	import flash.external.*;
	import flash.utils.*;
	import flash.net.*;
	public class Follow extends Sprite {
		public var stageW:Number;
		public var stageH:Number;
		private var colors:Array;
		private var letters:Array;
		//
		private var timeout:int;
		public function Follow() {
			stage.scaleMode = "noScale";
			stage.align = "topLeft";
			stage.addEventListener(Event.RESIZE, resizeHd);
			colors = [0xFF3533, 0xFDD200, 0x62C2F8, 0xAAC800];
			letters = ["C", "M", "P"];
			init();
		}
		private function init():void {
			stage.addEventListener(MouseEvent.MOUSE_MOVE, moveHd);
		}
		private function moveHd(e:Event):void {
			var rd:Number = Math.random();
			if (rd > 0.9) {
				var letter:Letter = new Letter(letters[Math.floor(Math.random()*letters.length)], colors[Math.floor(Math.random()*colors.length)], 12, 10, 1);
				addChild(letter);
			} else if (rd < 0.1) {
				var dot:Dot = new Dot(colors[Math.floor(Math.random()*colors.length)], Math.floor(Math.random()*5));
				addChild(dot);
			}
			
		}
		private function resizeHd(e:Event):void {
			
		}
		//开始布局绘图
		private function layout():void {
			stageW = stage.stageWidth;
			stageH = stage.stageHeight;
			
		}
	}
}